From 1afd5b5404a1c064abfe6711b95d59ea1bb13022 Mon Sep 17 00:00:00 2001
From: Ilion Beyst <ilion.beyst@gmail.com>
Date: Tue, 1 Nov 2022 23:04:46 +0100
Subject: highlight active tab

---
 .../src/routes/bots/[bot_name]/__layout.svelte      | 21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

(limited to 'web/pw-server/src/routes/bots/[bot_name]/__layout.svelte')

diff --git a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
index f445cbb..4393af6 100644
--- a/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
+++ b/web/pw-server/src/routes/bots/[bot_name]/__layout.svelte
@@ -16,7 +16,8 @@
 </script>
 
 <script lang="ts">
-  import { currentUser } from "$lib/stores/current_user";
+  import NavTab from "$lib/components/NavTab.svelte";
+import { currentUser } from "$lib/stores/current_user";
 
   export let bot;
   export let owner;
@@ -35,11 +36,11 @@
     {/if}
   </div>
   <div class="bot-tabs">
-    <a class="bot-tab" href={`/bots/${bot.name}`}>index</a>
-    <a class="bot-tab" href={`/bots/${bot.name}/matches`}>matches</a>
-    <a class="bot-tab" href={`/bots/${bot.name}/stats`}>stats</a>
+    <NavTab href={`/bots/${bot.name}`}>index</NavTab>
+    <NavTab href={`/bots/${bot.name}/matches`}>matches</NavTab>
+    <NavTab href={`/bots/${bot.name}/stats`}>stats</NavTab>
     {#if $currentUser && $currentUser["user_id"] === bot["owner_id"]}
-      <a class="bot-tab" href={`/bots/${bot.name}/versions`}>versions</a>
+      <NavTab href={`/bots/${bot.name}/versions`}>versions</NavTab>
     {/if}
   </div>
 </div>
@@ -79,14 +80,4 @@
   .bot-tabs {
     display: flex;
   }
-
-  .bot-tab {
-    padding: 8px;
-    text-decoration: none;
-    color: black;
-  }
-
-  .bot-tab:hover {
-    background-color: rgb(246, 248, 250);
-  }
 </style>
-- 
cgit v1.2.3

